package com.hhxy.utils;

import jdk.nashorn.internal.runtime.regexp.joni.Regex;
import org.mvel2.MVEL;
import sun.misc.Regexp;
import sun.misc.Unsafe;

import java.math.BigDecimal;
import java.math.MathContext;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentMap;
import java.util.concurrent.atomic.LongAdder;
import java.util.function.Consumer;
import java.util.function.Function;

/**
 * @auther:Lu Yao
 * @date:2022/3/3
 * @description:
 **/
public class test {
   /* private static  final Unsafe UNSAFE ;
    static {
        try {
            UNSAFE = Unsafe.getUnsafe();
        } catch (Exception e) {
            e.printStackTrace();
        }
    }*/
    public static void main(String[] args) {
       /* BigDecimal bigDecimal = new BigDecimal("11.1111111111111111111111111111111");
        BigDecimal bigDecimal1 = bigDecimal.setScale(1, BigDecimal.ROUND_HALF_DOWN);
        System.out.println(bigDecimal1.subtract(bigDecimal,new MathContext(10)));*/
//        HashMap<Object, Object> result = new HashMap<>();
//        result.put("a", true);
//        result.put("b", true);
//        result.put("c", true);
//        result.put("d", true);
//        Boolean aBoolean = (Boolean) MVEL.evalToBoolean("d||a", result);
//        System.out.println(aBoolean);
//        System.out.println("");
       /* String a="你好你好--dsfa123--啊啊啊啊sb%^&*))))$$+--=";
        String s = a.replaceAll("[^0-9a-zA-Z\\u4e00-\\u9fa5]", "");
        System.out.println(s);*/
//        String a="hello2";
//       final String b="hello";
//        String c="hello";
//        String b1=b+2;
//        String c1=c+2;
//        System.out.println(a==b1);
//        System.out.println(a==c1);
//        ConcurrentHashMap<String, LongAdder> testMap = new ConcurrentHashMap<>();
//        LongAdder longAdder = new LongAdder();
//        longAdder.add(10L);
//        longAdder.add(4L);
//        testMap.put("1", longAdder);
//        System.out.println(testMap.isEmpty());
//        List a=new ArrayList();
//        a.add(1);
//      int m=3;
//        if ((m=a.size()-1)<=0){
//            System.out.println(m);
//        }
        //System.out.println(m);
/*
        try {
            Calendar instance = Calendar.getInstance();
            int nowYear = instance.get(Calendar.YEAR);
            int nowMonth = instance.get(Calendar.MONTH)+1;
            int nowDay = instance.get(Calendar.DAY_OF_MONTH);
            //出生日期
            System.out.println("input:");
            Scanner scanner = new Scanner(System.in);
            String next = scanner.next();
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd");
            Date date = simpleDateFormat.parse(next);
            System.out.println(date);
            Calendar instance1 = Calendar.getInstance();
            instance1.setTime(date);
            int birYear = instance1.get(Calendar.YEAR);
            int birMonth = instance1.get(Calendar.MONTH)+1;
            int birDay = instance1.get(Calendar.DAY_OF_MONTH);

            int age=nowYear-birYear;
            if (birMonth>=nowMonth){
                if (birMonth==nowMonth){
                    if (birDay>=nowDay){
                        age--;
                    }
                }else {
                    age--;
                }
            }
            System.out.println("your age is"+age);

        } catch (ParseException e) {
            e.printStackTrace();
        }*/

    /*    Consumer<String> consumer= System.out::println;
        int a=2;
        assert a==1:"必须为1";
        consumer.accept("1111");
        System.out.println(a);
        boolean isSafe = false;
        assert isSafe : "Not safe at all";
        System.out.println("断言通过!");*/
      /*int[] a=new int[Character.MAX_VALUE];
        for (int i : a) {
            System.out.println(i);
        }*/
        System.out.println(UUID.randomUUID().toString().replaceAll("-", ""));
    }

}